﻿using System.Collections.Generic;
using System.Text;

namespace Dogshow.Win.Helpers
{
    public static class QueryBuilder
    {
         public static string CreateQueryString(Dictionary<string, object> parameters)
         {
             var sb = new StringBuilder();
             var addedQuery = false;
             foreach (var parameter in parameters)
             {
                 addedQuery = QueryStringHelpers.AppendQueryString(sb, addedQuery);
                 sb.Append(parameter.Key + "=" + parameter.Value);
             }
             QueryStringHelpers.RemoveTrailingAmpersand(sb);
             return sb.ToString();
         }
    }
}